1. Field of the Invention
The present invention pertains to the field of computer graphics. More particularly, the present invention relates to providing texel data from selected portions of a multi-resolutional texture map (referred to herein as a clip-map).
2. Related Art
Computer systems are commonly used for displaying graphical objects on a display screen. These graphical objects include points, lines, polygons, and three dimensional solid objects. By utilizing texture mapping techniques, color and other details can be applied to areas and surfaces of these objects. In texture mapping, a pattern image, also referred to as a xe2x80x9ctexture map,xe2x80x9d is combined with an area or surface of an object to produce a modified object with the added texture detail. For example, given the outline of a featureless cube and a texture map defining a wood grain pattern, texture mapping techniques can be used to xe2x80x9cmapxe2x80x9d the wood grain pattern onto the cube. The resulting display is that of a cube that appears to be made of wood. In another example, vegetation and trees can be added by texture mapping to an otherwise barren terrain model. Likewise, labels can be applied onto packages or cans for visually conveying the appearance of an actual product. Textures mapped onto geometric surfaces provide motion and spatial cues that surface shading alone might not provide. For example, a sphere rotating about its center appears static until an irregular texture or pattern is affixed to its surface.
The resolution of a texture varies, depending on the viewpoint of the observer. The texture of a block of wood displayed up close has a different appearance than if that same block of wood were to be displayed far away. Consequently, there needs to be some method for varying the resolution of the texture (e.g., magnification and minification). One approach is to compute the variances of texture in real time, but this filtering is too slow for complex textures and/or requires expensive hardware to implement.
A more practical approach first creates and stores a MIP-map (multum in parvo meaning xe2x80x9cmany things in a small placexe2x80x9d). The MIP-map consists of a texture pattern pre-filtered at progressively lower or coarser resolutions and stored in varying levels of detail (LOD) maps. See, e.g., the explanation of conventional texture MIP-mapping in Foley et al., Computer Graphics Principles and Practice, Second Edition, Addison-Wesley Publishing Company, Reading, Mass. (1990), pages 742-43 and 826-828 (incorporated by reference herein).
FIG. 1A shows a conventional set of texture LOD maps having prefiltered texel data associated with a particular texture. Four different levels of detail (LOD[O]-LOD[3]) are shown. Each successive coarser texture LOD has a resolution half that of the preceding LOD until a unitary LOD is reached representing an average of the entire high resolution base texture map LOD[0]. Thus, in FIG. 1A, LOD[O] is an 8xc3x978 texel array; LOD[1] is a 4xc3x974 texel array; LOD[2] is a 2xc3x972 texel array; and LOD [3] is a single 1xc3x971 texel array. Of course, in practice each LOD can contain many more texels, for instance, LOD[0] can be 8kxc3x978k, LOD[1] 4kxc3x974k, and so forth depending upon particular hardware or processing limits.
The benefit of MIP-mapping is that filtering is only performed once on texel data when the MIP-map is initially created and stored in LOD maps. Thereafter, texels having a dimension commensurate with pixel size are obtained by selecting the closest LOD map having an appropriate resolution. By obtaining texels from the pre-filtered LOD maps, filtering does not have to be performed during run-time. More sophisticated filtering operations can be executed beforehand during modeling without delaying real-time operation speed.
To render a display at the appropriate image resolution, a texture LOD is selected based on the relationship between the smallest texel dimension and the display pixel size. For a perspective view of a landscape 100, as shown in FIG. 1B, the displayed polygonal image is xe2x80x9cmagnifiedxe2x80x9d in a foreground region relative to polygonal regions located closer to the center horizon and background along the direction indicated by the arrow. To provide texture for pixels in the closest foreground region, then, texels are mapped from the finest resolution map LOD[0]. Appropriate coarser LODs are used to map texel data covering pixels located further away from the viewer""s eyepoint. Such multi-resolution texture MIP-mapping ensures that texels of the appropriate texture LOD gets selected during pixel sampling. To avoid discontinuities between images at varying resolutions, well-known techniques such as linear interpolation are used to blend the texel values of two LODs nearest a particular image pixel.
One significant drawback to conventional MIP-mapping, however, is the amount of memory consumed by the various texture LOD maps. Main memory in the form of a dynamic random access memory (DRAM) or a static random access memory (SRAM) is an expensive and inefficient site for a large texture MIP-map. Each additional level of detail map at a higher level of detail requires four times more memory. For example, a 16xc3x9716 texture array having 256 texture picture elements (texels), is four times bigger than an 8xc3x978 texture array which has 64 texels. To put this increase in perspective, a texture MIP-map having six levels of detail requires over 4,096 times more memory than the texture map at the finest resolution. Implementing large texture MIP-maps quickly becomes an expensive luxury. In addition, for large texture MIP-maps, many portions of the stored MIP-map are not used in a display image.
Memory costs become especially prohibitive in photographic texture applications where the source texture, such as, satellite data or aerial photographs, occupy a large storage area. Creating a pre-filtered MIP-map representation of such source texture data further increases memory consumption.
This problem is further exacerbated by the fact that in order to increase the speed at which images are rendered for display, many of the high-performance computer systems contain multiple processors. A parallel, multiple processor architecture typically stores individual copies of the entire MIP-map in each processor memory.
Thus, there is a need to efficiently implement large texture maps for display purposes so as to minimize attendant memory and data retrieval costs. Visual quality must not be sacrificed for memory savings. Final images in an improved texture mapping system need to be virtually indistinguishable from that of images generated by a traditional MIP-map approach.
There is also a need to maintain real-time display speeds even when navigating through displays drawn from large texture maps. For example, flight simulations must still be performed in real-time even when complex and voluminous source data such as satellite images of the earth or moon, are used to form large texture motifs.
Clip-map techniques have been developed to solve the above problems. A clip-map is a partial mip-map in which each level has been clipped to a specified maximum size. See, U.S. Pat. No. 5,760,783 issued to Migdal et al., and xe2x80x9cThe Clipmap: A Virtual Mip-Map,xe2x80x9d Computer Graphics Proceedings, Annual Conference Series, 1998, by Migdal et al., pp.151-158 (both of which are incorporated herein by reference). As recognized by the inventors, sharp transitions in blending may occur between clip-map tiles or levels. These sharp transitions can cause visible artifacts or discontinuities in a displayed image which are noticeable to a viewer.
A method, system, and computer program product modify blending between at least first and second clip-map tiles. Blending of a texel accessed in a modified blending region of the first clip-map tile is modified to provide a smoother blending profile between the first clip-map tile and a second clip-map tile. Sharp or sudden transitions in blending between the first and second clip-map tiles are reduced or avoided. Blending is forced to begin sooner than blending operations applied to clip-map tiles alone. The magnitude of the modification of blending is a function of the location of the texel within the modified blending region.
In one embodiment, a determination is made on whether a texel to be accessed lies within a modified blending region within the first clip-map tile. A modified blending coefficient b is calculated when the texel to be accessed lies within the modified blending region. For example, to determine whether a texel lies within a modified blending region, a check is made to determine whether a distance d is less than a blending distance D. Distance d is the distance between the texel being accessed and an edge of the first clip-map tile. Blending distance D is the distance between a blend boundary of the modified blending region and the edge of the first clip-map tile. Modified blending coefficient b can be calculated as a function of at least distance d. In one example of a linear function, the modified blending coefficient b is calculated according to the following equation: b=(Dxe2x88x92d)/D.
Further embodiments, features, and advantages of the present inventions, as well as the structure and operation of the various embodiments of the present invention, are described in detail below with reference to the accompanying drawings.